package team.stride.tabs.records;

import java.util.ArrayList;

import team.stride.database.crud.playlists.PlaylistsItem;
import team.stride.database.crud.users.UsersItem;

public class ReportPlaylist
{
	private PlaylistsItem playlist;
	private ArrayList<UsersItem> users;

	public ReportPlaylist(PlaylistsItem playlist, ArrayList<UsersItem> users)
	{
		this.playlist = playlist;
		this.users = users;
	}

	public PlaylistsItem getPlaylist()
	{
		return playlist;
	}

	public void setPlaylist(PlaylistsItem playlist)
	{
		this.playlist = playlist;
	}

	public ArrayList<UsersItem> getUsers()
	{
		return users;
	}

	public void setUsers(ArrayList<UsersItem> users)
	{
		this.users = users;
	}

	public String toHTMLString()
	{
		String pl = "<h5>" + getFont1("Name: ") + getFont2(playlist.getName()) + "<br/>" + 
		getFont1("Details: ")
				+ getFont2(playlist.getDetails()) + "</h5><ul>";
		
		for (UsersItem user : users)
		{
			pl += "<li><h6>" + getFont1("Name: ") + user.getName() + "<br/>" + getFont1("Network: ")
					+ user.getNetwork() + "</h6>";
		}
		return pl + "</ul>";
	}

	final static String getFont1(String text)
	{
		return "<font color='#777777'>" + text + "</font>";
	}

	final static String getFont2(String text)
	{
		return "<font color='#fe6700'>" + text + "</font>";
	}
}
